package com.taxi.driver.module.main.mine.evaluation;

import android.content.Context;
import android.widget.LinearLayout;

import com.qianxx.adapter.SuperAdapter;
import com.qianxx.adapter.internal.SuperViewHolder;
import com.taxi.driver.R;
import com.taxi.driver.module.vo.TagVO;

import java.util.ArrayList;

public class TagAdapter extends SuperAdapter<TagVO> {

    public TagAdapter(Context context) {
        super(context, new ArrayList<TagVO>(), R.layout.item_tag);
    }

    @Override
    public void onBind(SuperViewHolder holder, int viewType, int position, TagVO item) {
        holder.setText(R.id.tv_tilte,item.title);
        holder.setText(R.id.tv_number,item.number+"");
        LinearLayout ll = (LinearLayout) holder.getView(R.id.ll);
        if(item.number <= 10){
            ll.setBackgroundResource(R.drawable.r3_bg_white_blue);
        }else if(item.number > 10 && item.number <= 50){
            ll.setBackgroundResource(R.drawable.r3_bg_gray_blue);
        }else if(item.number > 50 && item.number <= 100){
            ll.setBackgroundResource(R.drawable.r3_bg_light_blue);
        }else if(item.number > 100){
            ll.setBackgroundResource(R.drawable.r3_bg_drak_blue);
        }
    }

}
